﻿using Company.Config;
using Company.Share.Prism;
using Company.UI.Language;

namespace Company.Main.ViewModels
{
    public class SystemSettingViewModel : BindableBase
    {
        public IRegionManager RegionManager { get; }
        public DelegateCommand<object> NavigateToComponentViewCommand { get;}
        public SystemSettingViewModel(IRegionManager regionManager)
        {
            NavigateToComponentViewCommand = new DelegateCommand<object>(NavigateToComponentView);
            RegionManager = regionManager;
        }
        /// <summary>
        /// 导航到组件视图
        /// </summary>
        /// <param name="obj">视图名称</param>
        private void NavigateToComponentView(object obj)
        {
            var viewName = obj as string;
            switch (viewName)
            {
                case ViewNames.LanguageComponentView:
                    RegionManager.RequestNavigate(RegionNames.NavigationRegion, ViewNames.LanguageComponentView);
                    break;
                case ViewNames.AcsComponetView:
                    RegionManager.RequestNavigate(RegionNames.NavigationRegion, ViewNames.AcsComponetView);
                    break;
                case ViewNames.SerialPortComponentView:
                    RegionManager.RequestNavigate(RegionNames.NavigationRegion, ViewNames.SerialPortComponentView);
                    break;
                default:
                    break;
            }
            
        }
    }
}
